

jQuery(function ($) {
    // 问答首页导航
    var nav_param = {
        "Nav[]": {
            "Nav": {
                "type": 1,
                "@order": "rank-",
                "use_flag": 1
            }
        },
        "Tdk": {
            "type": 1
        }
    };
    send_ajax('post', '/get', nav_param, function callback(data) {
        var html = "";
        if (data.code == 200 && data["Nav[]"]) {
            var data = data["Nav[]"];
            for (var i = 0; i < data.length; i++) {
                html += "  <li><a href=\"" + data[i].url + "\" target=\"_blank\">" + data[i].name + "</a></li>";
            };
            $('#nav_list').html(html);
        }
    });
    //点击搜索跳转搜索页
    $('#search_btn').click(function () {
        var keyword = $('#search').val();
        var keyword_p = $('#search').attr('placeholder');
        if (keyword == "") {
            keyword = keyword_p;
        }
        window.location.href = '/article/article_search.html?keyword=' + keyword;
    });
});